//
//  MGBaseRspModel.m
//  MortgageHelper
//
//  Created by zhangxiang on 16/8/8.
//  Copyright © 2016年 zhangxiang. All rights reserved.
//

#import "MGBaseRspModel.h"
#import "MJExtension.h"

@implementation MGBaseRspModel

+ (instancetype)MJmodelWithResponseObject:(NSDictionary *)responseDictionary
{
    MGBaseRspModel *model = [[self class] mj_objectWithKeyValues:responseDictionary[@"data"]];
    
    if (!model) {
        model = [[self class] new];
    }
    [model filledByDic:responseDictionary];
    return model;
}

- (void)filledByDic:(NSDictionary *)dic
{
    _resultCode = [dic[k_Resp_Body_Code] integerValue];
    _errorMessage = [dic[k_Resp_Body_Message] copy];
    _respData = [dic[k_Resp_Body_Data] copy];
}

@end
